	
	function validateData(dbVariable,dbKey,elementID){
		var result = true;
		var pattern = arValRegEx[dbVariable];
		if(pattern != undefined){
			var theRegExp = new RegExp(pattern,"i");
			var theValue = document.getElementById(elementID).value;
			
			if(!theRegExp.test(theValue)){
				var message = arValMsg[dbVariable];
				alert(message);
				result = false;
				// Comment out to disable return to previouse value
				var oldValElID = 'OV_' + elementID;
				var oldvalue = document.getElementById(oldValElID).value;
				if(oldvalue != undefined){
					document.getElementById(elementID).value = oldvalue;
					}
			}else{
				//alert("Matches!!");
				result = true;
				}
		
		}else{
			result = true;
		}
		return result;
	}
	
// This function will set the SD_ show date after the calendar is changed, allowing a show format different then the data source format	
function setshowdate(cal) {
		var date = cal.date;
		var fieldid = cal.params.inputField.id;
		var fieldname = cal.params.inputField.name;
		var keystring;
		namelength = fieldname.length;
		keystring = fieldid.substring(namelength+1);
		var showfield = document.getElementById("SD_" + fieldid);
		if(arShowDateFormat[fieldname] != undefined){
			showfield.value = date.print(arShowDateFormat[fieldname]);
		}else{
			showfield.value = date.print(arShowDateDefault);
		}
		cal.params.inputField.onblur();
			
		//alert(date.print("%A, %B %e, %Y"));
	}
	
	
	
	
	
// This calls the date onblur function in the format the calendar creator wants
function calldateonblur(cal){
	cal.params.inputField.onblur();
	cal.destroy();
}	
	
// this does nothing, but is a filler for autogenerated places where a function is needed	
	function donothing(){
		return 1;
	}
		
	function do_clearJScal(theform,eleid){
		document.getElementById(eleid).value = '';
		document.getElementById('SD_'+ eleid).value = '';
		document.getElementById(eleid).onblur();
	}
	
	function do_JScalSet(showid,fmt,targetid,tfmt){
		//alert("date = " + showdate + " format= " + fmt);
		//var mydate = new Date;
	
		var showdate = document.getElementById(showid).value;
		var mydate = DateFromString(showdate,fmt);
		
		//alert(mydate.toString());
		//alert(mydate.print(tfmt));
		
		if(mydate != undefined){
			document.getElementById(targetid).value = mydate.print(tfmt);
			document.getElementById(targetid).onblur();
		}else{
			
		}
		
	}
	